package ar.edu.utn.frba.disenio.aterrizar;

import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Before;

import ar.edu.utn.frba.disenio.aterrizar.*;

public class LatinoamerianoTest {
	
	@Test
	public void testParseaOk(){
		Latinoamericano latin=new Latinoamericano();
		String unStr1="25/10/2012";
		assertTrue("La fecha debe parsear con el formato latinoamericano dd/mm/yyyy",(!latin.parsear(unStr1).equals(null)));
	}
	
	@Test (expected = NoEsParseablePorFormatoException.class)  
    	public  void testFailPorFormatoInternacional(){
			Latinoamericano latin = new Latinoamericano();
			String unStr2="2012-11-25";
			latin.parsear(unStr2);
	}

	@Test (expected = NoEsParseablePorFormatoException.class)  
	public  void testFailPorFormatoNorteamericano(){
		Latinoamericano latin = new Latinoamericano();
		String unStr3="12-25-2012";
		latin.parsear(unStr3);
	}
	
	@Test (expected = NoEsParseablePorFormatoException.class)  
	public  void testFailPorFormatoVacio(){
		Latinoamericano latin = new Latinoamericano();
		String unStr5="";
		latin.parsear(unStr5);
	}
	
	@Test (expected = NoEsParseablePorFormatoException.class)  
	public  void testFailPorStringSimbolos(){
		Latinoamericano latin = new Latinoamericano();
		String unStr7="$%^$%^$&$";
		latin.parsear(unStr7);
	}
	
	@Test (expected = NoEsParseablePorFormatoException.class)  
	public  void testFailPorStringLetras(){
		Latinoamericano latin = new Latinoamericano();
		String unStr6="catorce de febrero";
		latin.parsear(unStr6);
	}
}
